<template>
  <el-card shadow="never">
    <div class="user-profile-card">
      <div class="user-avatar">
        <img :src="user.avatar" alt="User Avatar" class="avatar-image" />
      </div>
      <div class="user-info">
        <h2>{{ user.name }}</h2>
        <p>邮箱：{{ user.email }}</p>
        <p>电话：16921352354</p>
        <p>地址：湖南</p>
        <p>积分：2000</p>
      </div>
    </div>

    <!-- <el-button type="primary" @click="editProfile">编辑个人信息</el-button> -->
  </el-card>
</template>

<script setup>
import { defineProps, defineEmits } from 'vue';

const props = defineProps({
  user: {
    type: Object,
    required: true
  }
});

const emit = defineEmits(['editProfile']);

const editProfile = () => {
  emit('editProfile');
};
</script>

<style scoped>
.user-profile-card {
  display: flex;
  flex-direction: row;
  padding: 20px;
}

.user-avatar {
  display: flex;
  justify-content: center;
  align-items: center;
}


.avatar-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
}

.user-info {
  flex: 2;
  margin-left: 20px;
  text-align: left;
  font-size: 14px;
}

.user-info h2 {
  font-size: 1.8rem;
  margin: 0;
}

.user-info p {
  margin: 5px 0;
  color: #666;
}
</style>